package com.thortec.farmsys.utils;

import jodd.mail.Email;
import jodd.mail.MailServer;
import jodd.mail.SendMailSession;
import jodd.mail.SmtpServer;
import java.util.Map;

/**
 * 邮件工具类
 */
public class EmailUtil {

    public static  void sendEmail(Map map){
        Email email=Email.create();
        email.from("段博文","s6056826@163.com")
                .to("874264933@qq.com")
                .subject("祝你生日快乐", "utf-8")
                .htmlMessage("<html><p>你好啊，祝你生日快乐</p></html>");


        SmtpServer smtpServer = MailServer.create()
                .host("smtp.163.com")
                .auth("s6056826", "a525252")
                .port(25)
                .buildSmtpMailServer();

        SendMailSession session = smtpServer.createSession();
        session.open();
        session.sendMail(email);
        session.close();
    }
}
